<?php

class CollectionFinishCollectionAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * 完成收集品收集
     *
     * @param int $userId
     * @param int $collectionId 要完成的
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $collectionId, $reqTime)
    {
        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);

        return $this->buildResponse(
            array(
                CollectionService::get()->finish($userId, $collectionId)
            )
        );
    }
}